<?php
    include('../lib/conn.php');
    
    // 接收前端发送的数据
    $username = $_REQUEST['username'];
    $password = $_REQUEST['password'];
    $email = $_REQUEST['email'];
    $phone = $_REQUEST['phone'];

    $sql = "select * from reg where name='$username' and password='$password' and email='$email' and phone='$phone'";
    $result = $mysqli->query($sql);
    $num=$result->num_rows;
    echo $num;

    if($num>0){
        echo "<script>alert('登陆成功');location.href='../html/首页1.html?phone=$phone';</script>";
    }
    else{
        echo "<script>alert('用户名或密码不正确');location.href='../html/登录.html';</script>";
    }
    $mysqli->close();

?>